/**
 * Copyright &copy; 2012-2016 civet All rights reserved.
 */
package cn.mcsys.myadmin.modules.air.entity;

import cn.mcsys.myadmin.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 乘车点管理Entity
 * @author leopold
 * @version 2018-08-13
 */
public class AirRidePoint extends DataEntity<AirRidePoint> {

	public static final int NOW_CITY_POINT = 1;
	public static final int OUT_SIDE_CITY_POINT = 2;
	public static final int HOTEL_POINT = 3;
	public static final int OTHER = 4;

	private static final long serialVersionUID = 1L;
	private AirParkingLot airParkingLot;		// 目的地(也就是停车场)

	private Long airParkingLotId;

	public Long getAirParkingLotId() {
		return airParkingLotId;
	}

	public void setAirParkingLotId(Long airParkingLotId) {
		this.airParkingLotId = airParkingLotId;
	}

	private String name;		// 乘车点名称
	private String city;		// 城市
	private String position;		// 乘车点位置
	private String camera1;		// 摄像头1
	private String camera2;		// 摄像头2
	private String camera3;		// 摄像头3
	private String camera4;		// 摄像头4
	private String leader;		// 负责人
	private String phone;		// 负责人电话
	private Integer consumed;		// 耗时（min）
	private Integer paytype;		// 支付类型
	private String lon;		// 经度
	private String lat;		// 维度
	private Integer busSum;		// 专线巴士数量
	private Integer driverSum;		// 司机数量
	private Integer workerSum;		// 工作人员数量
	private Integer sliRetention;		// 轻微滞留人数
	private Integer serRetention;		// 严重滞留人数
	private Integer bookSeven;		// 7:00-7:30预约人数
	private Integer bookSevenH;		// 7:30-8:00预约人数
	private Integer bookEight;		// 8:00-8:30预约人数
	private Integer bookEightH;		// 8:30-9:00预约人数
	private Integer bookNine;		// 9:00-9:30预约人数
	private Integer bookNineH;		// 9:30-10:00预约人数
	private Integer bookTen;		// 10:00-10:30预约人数
	private Integer bookTenH;		// 10:30-11:00预约人数
	private Integer bookEleven;		// 11:00-11:30预约人数
	private Integer bookElevenH;		// 11:30-12:00预约人数
	private Integer bookTwelve;		// 12:00-12:30预约人数
	private Date modificationDate;		// 修改时间
	private String note;		// 备注
	private Integer dispatchType;
	private Integer appointType;
	private Integer waitingSum;
	private Integer route;
	private Integer rideType;
	private String interphone;

	public String getInterphone() {
		return interphone;
	}

	public void setInterphone(String interphone) {
		this.interphone = interphone;
	}

	public Integer getRideType() {
		return rideType;
	}

	public void setRideType(Integer rideType) {
		this.rideType = rideType;
	}

	public Integer getRoute() {
		return route;
	}

	public void setRoute(Integer route) {
		this.route = route;
	}

	public Integer getBookTwelve() {
		return bookTwelve;
	}

	public void setBookTwelve(Integer bookTwelve) {
		this.bookTwelve = bookTwelve;
	}

	public Integer getWaitingSum() {
		return waitingSum;
	}

	public void setWaitingSum(Integer waitingSum) {
		this.waitingSum = waitingSum;
	}

	public Integer getDispatchType() {
		return dispatchType;
	}

	public void setDispatchType(Integer dispatchType) {
		this.dispatchType = dispatchType;
	}

	public Integer getAppointType() {
		return appointType;
	}

	public void setAppointType(Integer appointType) {
		this.appointType = appointType;
	}

	public AirRidePoint() {
		super();
	}

	public AirRidePoint(Integer id){
		super(id);
	}

	public AirParkingLot getAirParkingLot() {
		return airParkingLot;
	}

	public void setAirParkingLot(AirParkingLot airParkingLot) {
		this.airParkingLot = airParkingLot;
	}

	@Length(min=0, max=32, message="乘车点名称长度必须介于 0 和 32 之间")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@Length(min=0, max=16, message="城市长度必须介于 0 和 16 之间")
	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}
	
	@Length(min=0, max=64, message="乘车点位置长度必须介于 0 和 64 之间")
	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}
	
	@Length(min=0, max=255, message="摄像头1长度必须介于 0 和 255 之间")
	public String getCamera1() {
		return camera1;
	}

	public void setCamera1(String camera1) {
		this.camera1 = camera1;
	}
	
	@Length(min=0, max=255, message="摄像头2长度必须介于 0 和 255 之间")
	public String getCamera2() {
		return camera2;
	}

	public void setCamera2(String camera2) {
		this.camera2 = camera2;
	}
	
	@Length(min=0, max=255, message="摄像头3长度必须介于 0 和 255 之间")
	public String getCamera3() {
		return camera3;
	}

	public void setCamera3(String camera3) {
		this.camera3 = camera3;
	}
	
	@Length(min=0, max=255, message="摄像头4长度必须介于 0 和 255 之间")
	public String getCamera4() {
		return camera4;
	}

	public void setCamera4(String camera4) {
		this.camera4 = camera4;
	}
	
	@Length(min=0, max=16, message="负责人长度必须介于 0 和 16 之间")
	public String getLeader() {
		return leader;
	}

	public void setLeader(String leader) {
		this.leader = leader;
	}
	
	@Length(min=0, max=16, message="负责人电话长度必须介于 0 和 16 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	public Integer getConsumed() {
		return consumed;
	}

	public void setConsumed(Integer consumed) {
		this.consumed = consumed;
	}
	
	public Integer getPaytype() {
		return paytype;
	}

	public void setPaytype(Integer paytype) {
		this.paytype = paytype;
	}
	
	public Integer getBusSum() {
		if(this.busSum == null){
			return 0;
		}
		return busSum;
	}

	public void setBusSum(Integer busSum) {
		this.busSum = busSum;
	}
	
	public Integer getDriverSum() {
		if(this.driverSum == null){
			return 0;
		}
		return driverSum;
	}

	public void setDriverSum(Integer driverSum) {
		this.driverSum = driverSum;
	}
	
	public Integer getWorkerSum() {
		if(workerSum == null){
			return 0;
		}
		return workerSum;
	}

	public void setWorkerSum(Integer workerSum) {
		this.workerSum = workerSum;
	}
	
	public Integer getSliRetention() {
		return sliRetention;
	}

	public void setSliRetention(Integer sliRetention) {
		this.sliRetention = sliRetention;
	}
	
	public Integer getSerRetention() {
		return serRetention;
	}

	public void setSerRetention(Integer serRetention) {
		this.serRetention = serRetention;
	}
	
	public Integer getBookSeven() {
		return bookSeven;
	}

	public void setBookSeven(Integer bookSeven) {
		this.bookSeven = bookSeven;
	}
	
	public Integer getBookSevenH() {
		return bookSevenH;
	}

	public void setBookSevenH(Integer bookSevenH) {
		this.bookSevenH = bookSevenH;
	}
	
	public Integer getBookEight() {
		return bookEight;
	}

	public void setBookEight(Integer bookEight) {
		this.bookEight = bookEight;
	}
	
	public Integer getBookEightH() {
		return bookEightH;
	}

	public void setBookEightH(Integer bookEightH) {
		this.bookEightH = bookEightH;
	}
	
	public Integer getBookNine() {
		return bookNine;
	}

	public void setBookNine(Integer bookNine) {
		this.bookNine = bookNine;
	}
	
	public Integer getBookNineH() {
		return bookNineH;
	}

	public void setBookNineH(Integer bookNineH) {
		this.bookNineH = bookNineH;
	}
	
	public Integer getBookTen() {
		return bookTen;
	}

	public void setBookTen(Integer bookTen) {
		this.bookTen = bookTen;
	}
	
	public Integer getBookTenH() {
		return bookTenH;
	}

	public void setBookTenH(Integer bookTenH) {
		this.bookTenH = bookTenH;
	}
	
	public Integer getBookEleven() {
		return bookEleven;
	}

	public void setBookEleven(Integer bookEleven) {
		this.bookEleven = bookEleven;
	}
	
	public Integer getBookElevenH() {
		return bookElevenH;
	}

	public void setBookElevenH(Integer bookElevenH) {
		this.bookElevenH = bookElevenH;
	}
	
	public Date getModificationDate() {
		return modificationDate;
	}

	public void setModificationDate(Date modificationDate) {
		this.modificationDate = modificationDate;
	}
	
	@Length(min=0, max=64, message="备注长度必须介于 0 和 64 之间")
	public String getNote() {
		return note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public String getLon() {
		return lon;
	}

	public void setLon(String lon) {
		this.lon = lon;
	}

	public String getLat() {
		return lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	/**
	 * 获取摄像头个数
	 * @return
	 */
	public String getCameraSum(){
		int sum = 0;
		if(camera1 != null){
			sum++;
		}
		if(camera2 != null){
			sum++;
		}
		if(camera3 != null){
			sum++;
		}
		if(camera4 != null){
			sum++;
		}
		return sum + "个";
	}

	public String getConsumedMin(){
		return consumed + "分钟";
	}

	public String getTypeText(){
		if(paytype!=null) {
			return paytype == 0 ? "免费" : "付费";
		}
		return null;
	}

	@Override
	public String toString() {
		return "AirRidePoint{" +
				"airParkingLot=" + airParkingLot +
				", airParkingLotId=" + airParkingLotId +
				", name='" + name + '\'' +
				", city='" + city + '\'' +
				", position='" + position + '\'' +
				", camera1='" + camera1 + '\'' +
				", camera2='" + camera2 + '\'' +
				", camera3='" + camera3 + '\'' +
				", camera4='" + camera4 + '\'' +
				", leader='" + leader + '\'' +
				", phone='" + phone + '\'' +
				", consumed=" + consumed +
				", paytype=" + paytype +
				", busSum=" + busSum +
				", driverSum=" + driverSum +
				", workerSum=" + workerSum +
				", sliRetention=" + sliRetention +
				", serRetention=" + serRetention +
				", bookSeven=" + bookSeven +
				", bookSevenH=" + bookSevenH +
				", bookEight=" + bookEight +
				", bookEightH=" + bookEightH +
				", bookNine=" + bookNine +
				", bookNineH=" + bookNineH +
				", bookTen=" + bookTen +
				", bookTenH=" + bookTenH +
				", bookEleven=" + bookEleven +
				", bookElevenH=" + bookElevenH +
				", modificationDate=" + modificationDate +
				", note='" + note + '\'' +
				", id=" + id +
				'}';
	}
}